<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1,user-scalable=no">
		<title>叮店系统管理平台-登录</title>
		<link rel="stylesheet" href="static/css/common.css" type="text/css"/>
    <!-- Bootstrap -->
		<link rel="stylesheet" href="static/css/bootstrap.min.css" type="text/css"/>
    <!-- Bootstrap -->
		<link rel="stylesheet" href="static/css/dataTables.bootstrap.min.css" type="text/css"/>
    <!-- Font Awesome-->
		<link rel="stylesheet" href="static/css/font-awesome.min.css" type="text/css"/>
    <!-- Custom Theme Style-->
		<link rel="stylesheet" href="static/css/custom.min.css" type="text/css"/>
	  <style type="text/css">
		.logo{height: 90px;}
		.login-title{margin-top: 30px;color: white;font-size:xx-large;}
		.login-username{margin-top: 50px;}
		.login-password{margin-top: 30px;}
		.btn-login{float: left;color: white; width: 100%; background: dodgerblue;}
		.btn-reset{color: white;margin-right:0px;}
		.btn-default.submit.btn-login{}
	</style>
	<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="static/js/md5.js"></script>
	<script>
		;$(function(){

			//登录
			submitLogin();
			function submitLogin(){
				$('.j_submit').attr({'disabled':true});
				$('.j_submit').click(function(){
					var userName=$('.j_userName').val();
					var password=hex_md5($('.j_passWord').val());
					var param={data:
						{"mobile":userName,
							"password":password
						}
					}
					var params=JSON.stringify(param);
					console.log(param,params);
					$.ajax({
						url:'http://dingdian-ppe.parllay.cn/wxserver/user/login',
						data:params,
						type:'POST',
						async:true,
						contentType:'application/json',
						dataType:'json',
						success:function(res){
							console.log('---------------',res);
							var status=res.status;
							if(status==true){
								var data=res.data;
								data=eval(data);
								//alert(data);
								console.log('数据',data);
								//creatPear();
								var mHref=$('.j_submit').attr('data-href');
								//提偶转
								$('.j_submit').attr({'disabled':false});
								$('.j_submit').attr({'href':mHref});
								//window.open('file:///C:/Users/%E9%83%9D%E6%B8%85%E6%8C%AF/Desktop/mayun/BackManage/productManage.html');
								//alert(mHref);
                // window.localStorage.setItem("storeManager",data.storeManager);
                window.localStorage.setItem("storeNo",data.storeNo);
                window.localStorage.setItem("mobile",data.mobile);
                window.localStorage.setItem("password",data.password);
								window.localStorage.setItem("wxUid",data.wxUid);
                window.localStorage.setItem("wxSid",data.wxSid);
								var wxUid=window.localStorage.getItem("wxUid");
								//alert(wxUid);
							}else{
								console.log('错误',res.message);
							}
						},
						error:function(err){
							console.log(err);
						}
					});
				});
			}
	});
	</script>
  </head>
  <body class="login" style="background-image: url(static/images/login.jpg)">
    <div>
      <a class="hiddenanchor" id="signup"></a>
      <a class="hiddenanchor" id="signin"></a>
      <div class="login_wrapper">
        <div class="animate form login_form">
          <div class="login_content">
            <!-- <form> -->
             <div>
              	<div>
              		<img class="logo" src="static/images/logo.png">
             	</div>
              	<div class="login-title">
              		叮店系统管理平台
             	</div>
             </div>
              <div class="login-username">
                <input type="text" class="form-control j_userName" placeholder="用户名"/>
              </div>
              <div class="login-password">
                <input type="password" class="form-control j_passWord" placeholder="密码"/>
              </div>
              <!--
              <div>
              	<a class="reset_pass btn-reset" style="font-weight: 100; font-size: 14px;" href="#">忘记密码？</a>
              </div>
              -->
              <div>
                <a class="btn btn-default submit btn-login j_submit" style="font-weight: 100; font-size: 16px; margin-top:25px;" href="javascript:;" data-href="productManage.html" disabled>登录</a>
              </div>
              <div class="clearfix"></div>
            <!-- </form> -->
          </div>
        </div>
        <!-- <div id="register" class="animate form registration_form">
          <section class="login_content">
            <form>
              <h1>Create Account</h1>
              <div>
                <input type="text" class="form-control" placeholder="Username" required="" />
              </div>
              <div>
                <input type="email" class="form-control" placeholder="Email" required="" />
              </div>
              <div>
                <input type="password" class="form-control" placeholder="Password" required="" />
              </div>
              <div>
                <a class="btn btn-default submit" href="javascript:;">Submit</a>
              </div>

              <div class="clearfix"></div>

              <div class="separator">
                <p class="change_link">Already a member ?
                  <a href="javascript:;" class="to_register"> Log in </a>
                </p>
                <div class="clearfix"></div>
                <br />
                <div>
                  <h1><i class="fa fa-paw"></i> Gentelella Alela!</h1>
                  <p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 3 template. Privacy and Terms</p>
                </div>
              </div>
            </form>
          </section>
        </div> -->
      </div>
    </div>
  </body>
</html>
